package com.emperor.course.logic;

import java.util.ArrayList;
import java.util.List;

import com.emperor.category.logic.Category;
import com.emperor.core.logic.BizModelBase;
import com.emperor.treatment.logic.Treatment;

public class CourseTreatmentModel extends BizModelBase implements CourseTreatment {
	private Long id;
	private String status;
	private Double quantity;
	private Course course;
	private Treatment treatment;
	
	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#getId()
	 */
	@Override
	public Long getId() {
		return id;
	}

	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#setId(java.lang.Object)
	 */
	@Override
	public void setId(Object id) {
		if (id != null) {
			if (id instanceof Long) {
				this.id = (Long) id;
			} else {
				try {
					this.id = new Long(id.toString());
				} catch (Exception e) {
				}
			}
		}
	}



	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#getStatus()
	 */
	@Override
	public String getStatus() {
		return status;
	}



	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#setStatus(java.lang.Object)
	 */
	@Override
	public void setStatus(Object status) {
		if (status != null) {
			if (status instanceof String) {
				this.status = (String) status;
			} else {
				try {
					this.status = status.toString();
				} catch (Exception e) {
				}
			}
		}
	}


	public Double getQuantity() {
		return quantity;
	}

	public void setQuantity(Object quantity) {
		if (quantity != null) {
			if (quantity instanceof Double) {
				this.quantity = (Double) quantity;
			} else {
				try {
					this.quantity = new Double(quantity.toString());
				} catch (Exception e) {
				}
			}
		}
	}

	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#getCourse()
	 */
	@Override
	public Course getCourse() {
		return course;
	}



	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#setCourse(java.lang.Object)
	 */
	@Override
	public void setCourse(Object course) {
		if (course != null) {
			if (course instanceof Course) {
				this.course = (Course) course;
			}
		}
	}



	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#getProduct()
	 */
	@Override
	public Treatment getTreatment() {
		return treatment;
	}



	/* (non-Javadoc)
	 * @see com.emperor.course.logic.CourseProduct#setProduct(java.lang.Object)
	 */
	@Override
	public void setTreatment(Object treatment) {
		if (treatment != null) {
			if (treatment instanceof Treatment) {
				this.treatment = (Treatment) treatment;
			}
		}
	}



	@Override
	public List<String> getFieldNames() {
		List<String> fieldNames = new ArrayList<String>();
		
		fieldNames.add(FLD_ID);
		fieldNames.add(FLD_STATUS);
		fieldNames.add(FLD_QUANTITY);

		fieldNames.add(FLD_CRTBY);
		fieldNames.add(FLD_CRTDATE);
		fieldNames.add(FLD_UPDBY);
		fieldNames.add(FLD_UPDDATE);
		
		
		return fieldNames;
	}
	
	
}
